package idv.cjcat.signals.tests.cases {
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import idv.cjcat.signals.INativeSignal;
	import idv.cjcat.signals.NativeSignal;
	
	public class NativeSignalTest extends CJSignalsTestCase {
		
		public function NativeSignalTest(testMethod:String = null) {
			super(testMethod);
		}
		
		private var _flag:Boolean;
		
		public function testEvents():void {
			var d:IEventDispatcher = new EventDispatcher();
			var s:INativeSignal = new NativeSignal(d, Event.COMPLETE, 0, false);
			
			var f:Function = function(e:Event):void {
				_flag = true;
			};
			
			_flag = false;
			s.add(f);
			d.dispatchEvent(new Event(Event.COMPLETE));
			assertTrue(_flag);
		}
	}
}